import request from '@/utils/request';

// 数据展示登录方法
export function getMenuList (pageNumber, pageSize) {
  const data = {
    pageNumber,
    pageSize
  }
  return request({
    url: '/menu/list?page=' + pageNumber + '&size=' + pageSize,
    headers: {
      isToken: false
    },
    method: 'get',
    data: data
  })
}
export function findAll () {
  return request({
    url: '/menu/findAll',
    headers: {
      isToken: false
    },
    method: 'get'
  })
}
export function getMenuListByPost (tableData) {
  return request({
    url: '/menu/list',
    headers: {
      isToken: false
    },
    method: 'post',
    data: tableData
  })
}
export function save (data) {
  return request({
    url: '/menu/save',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function update (data) {
  return request({
    url: '/menu/update',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function delMenu (data) {
  return request({
    url: '/menu/delete',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getDyMenuRouter (userName) {
  return request({
    url: '/menu/getBackgroundRouter/' + userName,
    headers: {
      isToken: false
    },
    method: 'get'
  })
}
